package com.rpframework.utils

import org.junit.Test

class XmlUtilTest {
    var xml = """
<xml>
   <returnCode><![CDATA[SUCCESS]]></returnCode>
   <returnMsg><![CDATA[OK]]></returnMsg>
   <appid><![CDATA[wx2421b1c4370ec43b]]></appid>
   <mchId><![CDATA[10000100]]></mchId>
   <nonce_str><![CDATA[IITRi8Iabbblz1Jc]]></nonce_str>
   <openid><![CDATA[oUpF8uMuAJO_M2pxb1Q9zNjWeS6o]]></openid>
   <sign><![CDATA[7921E432F65EB8ED0CE9755F0E86D72F]]></sign>
   <resultCode><![CDATA[SUCCESS]]></resultCode>
   <prepay_id><![CDATA[wx201411101639507cbf6ffd8b0779950874]]></prepay_id>
   <trade_type><![CDATA[JSAPI]]></trade_type>
</xml>
"""

    data class Resp(var returnCode: String? = null,
                    var returnMsg: String? = null,
                    var resultCode: String? = null)

    @Test
    fun xml2Po() {
        val res = XmlUtil.xml2Po(xml, Resp::class.java)
        println(res)
    }
}
